//
//  DDBossJobService.m
//  DingDongZP
//
//  Created by Jyh on 16/4/26.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

#import "DDBossJobService.h"

@implementation DDBossJobService

- (void)creatJobInfoWithDictionary:(NSDictionary *)paraDic
                      SuccessBlock:(successBlock)successBlock
                         failBlock:(faileBlock)failBlock
{
    NSString *URLString = [[DDAPIGenerate sharedInstance] API:@"employer_create_job"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    [params addEntriesFromDictionary:paraDic];
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];
}

- (void)editJobInfoWithDictionary:(NSDictionary *)paraDic
                      SuccessBlock:(successBlock)successBlock
                         failBlock:(faileBlock)failBlock
{
    NSString *URLString = [[DDAPIGenerate sharedInstance] API:@"employer_edit_job"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    [params addEntriesFromDictionary:paraDic];
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];
}

- (void)deleteJobInfoWithJobId:(NSString *)jobId
                  SuccessBlock:(successBlock)successBlock
                     failBlock:(faileBlock)failBlock
{
    NSString *URLString = [[DDAPIGenerate sharedInstance] API:@"employer_delete_job"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    
    if (jobId) {
        params[@"job_id"] = jobId;
    }
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];
}

- (void)queryMyselfAllJobInfoSuccessBlock:(successBlock)successBlock
                                failBlock:(faileBlock)failBlock
{
    NSString *URLString = [[DDAPIGenerate sharedInstance] API:@"employer_view_myself_all_jobs"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];
}

- (void)queryMyselfJobInfoWithJobId:(NSString *)jobId
                       SuccessBlock:(successBlock)successBlock
                          failBlock:(faileBlock)failBlock
{
    NSString *URLString = [[DDAPIGenerate sharedInstance] API:@"employer_view_myself_job"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    
    if (jobId) {
        params[@"job_id"] = jobId;
    }
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];
}

- (void)setMyselfCurrentJobId:(NSString *)jobId
                 SuccessBlock:(successBlock)successBlock
                    failBlock:(faileBlock)failBlock
{
    NSString *URLString = [[DDAPIGenerate sharedInstance] API:@"employer_set_current_job"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    
    if (jobId) {
        params[@"current_jobid"] = jobId;
    }
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];
}

- (void)queryRecommendJobfindersWithJobId:(NSString *)jobId
                                     page:(NSString *)page
                             SuccessBlock:(successBlock)successBlock
                                failBlock:(faileBlock)failBlock
{
    NSString *URLString = [[DDAPIGenerate sharedInstance] API:@"employer_discover_jobfinders_match"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    
    if (jobId) {
        params[@"job_id"] = jobId;
    }
    if (page) {
        params[@"page"] = page;
    }
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];
}

- (void)queryJobfindersWithJobId:(NSString *)jobId
                           order:(NSString *)order
                            page:(NSString *)page
                    SuccessBlock:(successBlock)successBlock
                       failBlock:(faileBlock)failBlock
{
    NSString *URLString = [[DDAPIGenerate sharedInstance] API:@"employer_discover_jobfinders_order"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    
    if (jobId) {
        params[@"job_id"] = jobId;
    }
    if (order) {
        params[@"order"] = order;
    }
    if (page) {
        params[@"page"] = page;
    }
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];
}

- (void)queryJobfindersWithJobId:(NSString *)jobId
                      Filtertype:(NSString *)filtertype
                        FilterID:(NSString *)filterId
                            page:(NSString *)page
                    SuccessBlock:(successBlock)successBlock
                       failBlock:(faileBlock)failBlock
{
    NSString *URLString = [[DDAPIGenerate sharedInstance] API:@"employer_discover_jobfinders_filter"];
    
    NSMutableDictionary *params = [@{} mutableCopy];
    
    if (jobId) {
        params[@"job_id"] = jobId;
    }
    if (filtertype) {
        params[@"filtertype"] = filtertype;
    }
    if (filterId) {
        params[@"filterid"] = filterId;
    }
    if (page) {
        params[@"page"] = page;
    }
    
    DDNetWorkManager *manager = [DDNetWorkManager shareManager];
    
    [manager POST:URLString parameters:params success:successBlock failure:failBlock];
}

@end
